<ui:component xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:s="http://jboss.com/products/seam/taglib"
	xmlns:m="http://www.ol4jsf.org"
	xmlns:a4j="http://richfaces.org/a4j">

	<style>
		.noMaskClass .rich-mpnl-mask-div {
			display:none;
		}
	</style>
	
	
	<rich:modalPanel id="undoPanelToolbox" width="250" height="200" zindex="10000" resizeable="false">
		<f:facet name="header">
			<h:outputText value="#{messages['dataentry.undo_toolbox_desc']}"/>
		</f:facet>
		
		<f:facet name="controls">
			<h:panelGroup>
				<h:graphicImage value="/img/close.png" styleClass="hidelink"
					id="hideUndoPanel" />
				<rich:componentControl for="undoPanelToolbox" attachTo="hideUndoPanel"
					operation="hide" event="onclick" />
			</h:panelGroup>
		</f:facet>
		
		<h:form>
			<br />
			<h:outputText value="#{messages['dataentry.undo.message']}" style="color:Red;"/>
			<br />
			<br />
			<div align="center">
				<ui:remove>
				<!-- FUTURA EXPANSION -->
				<a4j:commandButton value="Deshacer ultimo"
				action="#{dataEntryHelper.undoHelper.applyUndo}"
				reRender="requestedParcelList" ajaxSingle="true" immediate="true"
				oncomplete="if (#{facesContext.maximumSeverity==null}) {clearControls(); drawParcels();} else {#{rich:component('msgPanel')}.show();}">
					<f:setPropertyActionListener target="#{dataEntryHelper.requestedParcels}" value="#{null}" />
					<f:setPropertyActionListener target="#{dataEntryHelper.neighborParcels}" value="#{null}" />
				</a4j:commandButton>
				</ui:remove>
				<br />
				<h:panelGrid columns="2">
					<a4j:commandButton value="#{messages['dataentry.undo.btn_undo_all']}"
					action="#{dataEntryHelper.undoHelper.applyUndoAll}"
					reRender="requestedParcelList" ajaxSingle="true" immediate="true"
					oncomplete="if (#{facesContext.maximumSeverity==null}) { clearControls(); drawParcels(); #{rich:component('undoPanelToolbox')}.hide(); } else {#{rich:component('msgPanel')}.show();}">
						<f:setPropertyActionListener target="#{dataEntryHelper.requestedParcels}" value="#{null}" />
						<f:setPropertyActionListener target="#{dataEntryHelper.neighborParcels}" value="#{null}" />
					</a4j:commandButton>
					
					<a4j:commandButton value="#{messages['button.cancel']}"
					ajaxSingle="true" immediate="true"
					oncomplete="#{rich:component('undoPanelToolbox')}.hide();" type="button">
					</a4j:commandButton>
				</h:panelGrid>
			</div>
		</h:form>
	</rich:modalPanel>
	
</ui:component>
